<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="time"></div>
    <script src="./util.js"></script>
    <script>
        var time = document.querySelector('#time');
        baseUtil.countDown(new Date(Date.now() + 10* 1000), (data) => {
            var str = data.yyyy + '年 ' + data.MM + '月 ' + data.dd + '日 ' + 
                data.hh + '小时 ' + data.mm + '分 ' + data.ss + '秒 ' + data.ms + ' ms'
            time.innerHTML = str;
        });

        console.log(JSON.stringify(baseUtil.parseUrl('http://xjzheng.cn/memory/doc/index.html?name=xu&id=333#go'), null ,4))

        baseUtil.storage('session').set('name', 'xu', 2)
        console.log(baseUtil.storage('session').get('name'))

        console.log(baseUtil.formatDate(new Date()));

        var evt = new baseUtil.EventBus();
        evt.on('haha', (s1, s2) => {
            console.log(s1 + ' ----- ' + s2);
        });

        setTimeout(() => {
            evt.emit('haha', 1, 2);
        }, 1000)


        var handler = baseUtil.lockHandler(function (evt, unlock) {
            console.log(evt);
            setTimeout(() => {
                console.log('解锁')
                unlock();
            }, 2000);
        })
        
        document.onclick = handler;
    </script>
</body>
</html>